<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class RenewDeferOperateHistory extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('renew_defer_operate_history', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('shopId')->default(0)->comment('rms shopId');
            $table->unsignedInteger('shopCode')->default(0)->comment('rms shopCode');
            $table->string("orderNo", 60)->default("")->comment("open_shop_sign_order.orderNo");
            $table->unsignedInteger("lastEndTime")->default(0)->comment("合同有效期 ｜ 上次续签延期截止日期");
            $table->unsignedInteger("endTime")->default(0)->comment("续签延期截止日期");
            $table->unsignedInteger("status")->default(0)->comment("续签延期状态 0 - 正常 1 - 续签订单签约关闭 2 - 脚本执行关闭订货关闭");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->tinyInteger('isDeleted')->default(0);
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '开店续签 - 延期操作历史记录';

            $table->index('orderNo', 'idx_orderNo');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('renew_defer_operate_history');
    }
}
